package com.yangaobo.dto;

import com.yangaobo.constant.MC;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author 杨奥博
 */
@Schema(description = "员工修改DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EmpUpdateDTO implements Serializable {

    @Schema(description = "员工主键")
    @NotNull(message = "员工主键不能为空")
    @Min(value = 1, message = "员工主键必须大于0")
    private Long id;

    @Schema(description = "员工用户名")
    @Pattern(regexp = MC.Regex.USERNAME_RE, message = MC.Regex.USERNAME_RE_MSG)
    private String username;

    @Schema(description = "员工手机号")
    @Pattern(regexp = MC.Regex.PHONE_RE, message = MC.Regex.PHONE_RE_MSG)
    private String phone;

    @Schema(description = "员工微信")
    private String wechat;

    @Schema(description = "员工邮箱")
    @Pattern(regexp = MC.Regex.EMAIL_RE, message = MC.Regex.EMAIL_RE_MSG)
    private String email;

    @Schema(description = "员工性别")
    @Min(value = 0, message = "员工性别必须大于等于0")
    @Max(value = 2, message = "员工性别必须小于等于2")
    private Integer gender;

    @Schema(description = "员工年龄")
    @Min(value = 18, message = "员工年龄必须大于等于18")
    @Max(value = 60, message = "员工年龄必须小于等于60")
    private Integer age;

    @Schema(description = "员工省份")
    private String province;

    @Schema(description = "员工详细地址")
    private String address;

    @Schema(description = "员工姓名")
    private String realname;

    @Schema(description = "员工身份证号")
    @Pattern(regexp = MC.Regex.ID_CARD_RE, message = MC.Regex.ID_CARD_RE_MSG)
    private String idcard;

    @Schema(description = "部门外键")
    @Min(value = 1, message = "部门外键必须大于等于1")
    private Long fkDeptId;

    @Schema(description = "员工描述")
    private String info;
}

